New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor #57
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
also fixed some linting errors (semicolons & equals)
…a path as it's mainly the code of .analyze, use it there
• use the `in` operator more frequently (it's much nicer than `typeof foo !== "undefined"` + is more readable) • removed some garbage • added some comments
in L54, err would have always be falsey (or the function had returned earlier)
This reverts commit a7c35d1.
also moved the creation of the find-dependencies path to the surrounding scope
this is the functionality that is described in the comments, but wasn't implemented (yet)
a folder should never contain a file that has the folder's path as it's name
the last change broke most tests, so .findNextDir is what's actually wanted for .npmAnalyze
we don't use more, so don't do anything fancy
• removed scanning scripts as they weren't implemented properly (they just looped a couple of times without doing anything) • simplified signature of mergeDependencies • return errors in .package • also updated some comments
if (!options || !options.target) { | ||
// | ||
// If there are no `options` and no `options.target` property | ||
// respond with the appropriate error. | ||
// | ||
callback(new Error('options and options.target are required')); | ||
return emitter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs review. Is this depended upon anywhere?
Guessing not, as in the error we don't return any ee.
LGTM. Seems like great work by @fb55 Tests pass locally |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As you might have seen, I did some refactoring in the
refactor
branch. Mainly removing unused code, improving and abstracting some stuff and introducing two new public methods:analyzer.path
does ra's magic on a path, no matter what kind of file is behind it.analyzer.findNextDir
does what.findModulesDir
did so long: Return the next directory for a path..findModulesDir
now actually searches for a directory containing either anode_modules
dir or apackage.json
file.findit
is no longer a dependency, as.path
(which is an abstraction of.dir
) can do the job.Please have a look at the code, it's possible that I've missed something. (All tests pass at least.)